{% load account_tags %}
<ul class="nav pull-right">
    {% if request.user.is_authenticated %}
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                {% user_display request.user %}
                <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
                <li><a href="{% url account_settings %}"><i class="icon-user"></i> Settings</a></li>
                <li class="divider"></li>
                <li><a href="{% url account_logout %}"><i class="icon-off"></i> Log out</a></li>
            </ul>
        </li>
    {% else %}
        <li><a href="{% url account_login %}">Log in</a></li>
        {% if ACCOUNT_OPEN_SIGNUP %}
            <li class="navbar-text">or</li>
            <li><a href="{% url account_signup %}">Sign up</a></li>
        {% endif %}
    {% endif %}
</ul>